Skip to content

Conversation

@Peter-Levine
Copy link

Building tests with GCC-6.3.0 fails with:

/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp: In member function 'bool SimpleFile::exists() const':
/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp:93:12: error: cannot convert 'std::ifstream {aka std::basic_ifstream<char>}' to 'bool' in return
     return ifile;
            ^~~~~
/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp: In static member function 'static bool SimpleFile::exists(const char*)':
/var/tmp/portage/dev-python/shiboken-1.2.2/work/shiboken-1.2.2/tests/libsample/simplefile.cpp:100:12: error: cannot convert 'std::ifstream {aka std::basic_ifstream<char>}' to 'bool' in return
     return ifile;
            ^~~~~

Post C++11, implicit conversion to bool from an istream of ostream object is not allowed.

Modern C++ dialects require an explicit cast to bool from a stream object, instead of an implicit cast (via an implicit cast to a void *).
@CLAassistant
Copy link

CLAassistant commented Nov 15, 2024

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants